// #include "stdio.h"
// #include "drv_spiflash.h"
// #include "soc.h"
// #include "k_api.h"

// #include "kv_conf.h"
// #include "kv_adapt.h"

// #include "aos/hal/flash.h"

// spiflash_handle_t spiFlashHandle = NULL;
// spiflash_info_t *info = NULL;

// typedef struct {
// 	spiflash_info_t spiflashinfo;
// 	spiflash_event_cb_t cb;
// 	spiflash_status_t status;
// } ck_spiflash_priv_t;


// void QSPI_flash_init()
// {
//     int ret;
// 	spiFlashHandle = csi_spiflash_initialize(0, NULL);

// 	//16M init
//     ck_spiflash_priv_t *spiflash_priv = (ck_spiflash_priv_t *)spiFlashHandle;
// 	spiflash_priv->spiflashinfo.end          = CSKY_QSPIMEM_BASE + 0x1000 * 0x800 *2;
//     spiflash_priv->spiflashinfo.sector_count = 0x800 * 2;

// 	info = csi_spiflash_get_info(spiFlashHandle);
// }

// int32_t custom_flash_read(uint32_t offset, void *buf, uint32_t nbytes)
// {
//     return hal_flash_read((hal_partition_t)HAL_PARTITION_CUSTOM_1, &offset, buf, nbytes);
// }

// int32_t custom_flash_write(uint32_t offset, void *buf, uint32_t nbytes)
// {
//     return hal_flash_write((hal_partition_t)HAL_PARTITION_CUSTOM_1, &offset, buf, nbytes);
// }

// int32_t custom_flash_erase(uint32_t offset, uint32_t size)
// {
//     return hal_flash_erase((hal_partition_t)HAL_PARTITION_CUSTOM_1, offset, size);
// }
